package com.goldgov.code.json;

/**
 * LiuHG
 */
public class FormField {
    private String name;
    private String label;
    private ControlType type;
    private Validation validation;
    private Boolean isListField;
    
    private int length;
    private String format;

    public FormField(String name,String label,ControlType type,Validation validation){
        this.name = name;
        this.label = label;
        this.type = type;
        this.validation = validation;
        isListField = false;
    }

    public FormField(String name,String label,ControlType type,Validation validation,Boolean isListField){
        this.name = name;
        this.label = label;
        this.type = type;
        this.validation = validation;
        this.isListField = isListField;
    }

    public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getLabel() {
		return label;
	}

	public void setLabel(String label) {
		this.label = label;
	}

	public ControlType getType() {
		return type;
	}

	public void setType(ControlType type) {
		this.type = type;
	}

	public Validation getValidation() {
        return validation;
    }

    public void setValidation(Validation validation) {
        this.validation = validation;
    }

    public Boolean getListField() {
        return isListField;
    }

    public void setListField(Boolean listField) {
        isListField = listField;
    }
    
    public int getLength() {
		return length;
	}

	public void setLength(int length) {
		this.length = length;
	}

	public String getFormat() {
		return format;
	}

	public void setFormat(String format) {
		this.format = format;
	}



	public enum ControlType{
        Select,//下拉框
        Input,// 普通
        RemoteSelect,// 标准字典
        InputNumber,// 数字输入框
        DatePicker,// 日期
        TextArea// 文本域
    }

    public enum Validation{
        required,// 必填
        maxLength,// 长度
        email,
        phoneNumber,
        idCard;
    }
}
